<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box1 {
        position: relative;
        height: 35px;
        width: 250px;
        border: 1px solid black;

    }

    .box1::after {
        content: '';
        position: absolute;
        top: 0;
        right: 20px;
        width: 15px;
        height: 15px;
        border-right: 1px solid #000;
        border-bottom: 1px solid #000;
        transform: rotate(45deg);

        /*用2个边框就可以实现  倒转的小三角*/
        transition: all 0.2s;
    }

    .box1:hover::after {
        transform: rotate(225deg);
    }

    .box2 {
        width: 200px;
        height: 200px;
        border: 1px solid pink;
        margin: 100px auto;
        overflow: hidden;
    }

    .box2::before {
        content: '黑马';
        display: block;
        width: 100%;
        height: 100%;
        background-color: pink;
        transform: rotate(90deg);
        transform-origin: left bottom;
        transition: all 0.4s;
    }

    .box2:hover::before {
        transform: rotate(0deg);
    }
</style>

<body>
    <div class="box1"></div>
    <div class="box2">

    </div>
</body>

</html>